﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlReportXNT.ascx.cs" Inherits="UserControl_ControlReportXNT" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPivotGrid" tagprefix="dxwpg" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2.Export, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.XtraPivotGrid.Web" tagprefix="dxpgw" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>


<script type="text/javascript">
    function pageLoad() {



        $("#<%= imgBtnAdd.ClientID %>").click(function () {

            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });

        });
        $("#<%= imgBtnSave.ClientID %>").click(function () {
            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });
            setTimeout($.unblockUI, 5000);
        });
        $("#<%= ImgBtnRefresh.ClientID %>").click(function () {
            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });
            setTimeout($.unblockUI, 5000);
        });
      

        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }

    }

</script>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="imgBtnSave" />
</Triggers>
    <ContentTemplate>
     <div class="direct_container_right_titletop direct_colleft">
                     Báo cáo xuất nhập tồn
                </div>
                
                <!-- Button chuc nang-->
                  <div class="direct_menu_report_page direct_colleft">
                   Chọn tháng :
                    <asp:DropDownList ID="DropMonthy" runat="server">
                    </asp:DropDownList>
                   
                    <asp:ImageButton ID="imgBtnAdd" CausesValidation="false" onclick="imgBtnAdd_Click" ToolTip="Lấy dữ liệu"  ImageUrl="~/Images/Document.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="imgBtnSave" onclick="imgBtnSave_Click" CausesValidation="false" ToolTip="Xuất ra file excel dạng thường" ImageUrl="~/Images/download.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="ImgBtnRefresh" onclick="imgBtnRefresh_Click" CausesValidation="false" ToolTip="Refresh lại dữ liệu" ImageUrl="~/Images/Refresh.png" Width="32px" Height="32px" runat="server" />
                    
                    
                </div>
                <!-- End Button chuc nang-->
                <div class="clear"></div>
                 <hr />

                
                   <table>
                   
                    <tr>
                    <td>
                
               
       
       <dxpgw:ASPxPivotGridExporter ID="ASPxPivotGridExporter1" ASPxPivotGridID="ASPxPivotGrid1" runat="server" Width="100%">
        </dxpgw:ASPxPivotGridExporter>
        <dxwpg:ASPxPivotGrid ID="ASPxPivotGrid1" CustomizationFieldsVisible="true"  runat="server">
                 <Fields>
                <dxwpg:PivotGridField ID="Pivotsitename" Area="FilterArea"  AreaIndex="0" 
                         Caption="Nhà phân phối" FieldName="sitename">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="PivotKHO" Area="RowArea"  AreaIndex="1" 
                         Caption="Kho" FieldName="KHO">
                </dxwpg:PivotGridField>
                
                <dxwpg:PivotGridField ID="PivotGroup" Area="FilterArea" Visible="False"  AreaIndex="2" 
                         Caption="Gam hàng" FieldName="Group">
                </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="PivotChannel" Area="FilterArea" Visible="False"  AreaIndex="3" 
                         Caption="Nhóm sản phẩm" FieldName="Channel">
                </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="PivotItemKey" Area="RowArea"  AreaIndex="4" 
                         Caption="Tên hàng theo NPP" FieldName="ItemKey">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="PivotMonth" Area="ColumnArea"  AreaIndex="0" 
                         Caption="Tháng" FieldName="Month">
                </dxwpg:PivotGridField>
            
                <dxwpg:PivotGridField ID="PivotTD" Area="DataArea"  AreaIndex="0" 
                         Caption="Tồn đầu" CellFormat-FormatType="Numeric" FieldName="TD">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="PivotSaleQty" Area="DataArea"  AreaIndex="1" 
                         Caption="Xuất ra" CellFormat-FormatType="Numeric" FieldName="SaleQty">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="PivotGetQty" Area="DataArea"  AreaIndex="2" 
                         Caption="Nhập vô" CellFormat-FormatType="Numeric" FieldName="GetQty">
                </dxwpg:PivotGridField>

                 <dxwpg:PivotGridField ID="PivotCQTy" Area="DataArea"  AreaIndex="3" 
                         Caption="Hàng trả" CellFormat-FormatType="Numeric" FieldName="CQTy">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="PivotTC" Area="DataArea"  AreaIndex="4" 
                         Caption="Tồn cuối"  CellFormat-FormatType="Numeric" FieldName="TC">
                </dxwpg:PivotGridField>
               

                </Fields>
                <OptionsPager Visible="False">
               </OptionsPager>
               <OptionsView ShowColumnGrandTotals="False" ShowRowGrandTotals="False" ShowRowTotals="False" ShowColumnTotals="False" />
        </dxwpg:ASPxPivotGrid>
        </td>
       </tr>
        </table>
        <dxpc:ASPxPopupControl ID="MessageBox" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="DRM-S" runat="server" Height="91px" 
        Width="601px">
        <ContentCollection>
<dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True"></dxpc:PopupControlContentControl>
</ContentCollection>
    </dxpc:ASPxPopupControl>  
  </ContentTemplate>
  </asp:UpdatePanel>